class GT {
    constructor() {
        this.initData();
        this.timeImg();

    }
    initData() {
        this.TimeImgW = 270;
        // 游戏时间
        this.time = 90;
        // 每次减少的时间值
        this.reduce = this. TimeImgW / (this.time * 5);
    }
    timeImg() {
        this.Timg = new Image();
        this.Timg.src = './img/progress.png';
    }
    logic(){
        this.TimeImgW -= this.reduce;
        if(this.TimeImgW<=0){
            this.TimeImgW = 0;
            this.RState();
            
        }
    }
    run(paint){
        this.logic();
        this.onDraw(paint);
    }
    onDraw(paint){
        paint.drawImage(this.Timg,95,110,this.TimeImgW,28);
    }
}